<template>
  <div class="edit-dialog">
    <Button icon="md-build" type="success" @click="modal1 = true">编辑</Button>
    <Modal
      v-model="modal1"
      title="编辑">
      <Form :model="formItem" :label-width="80">
        <FormItem label="部门编号">
          <Input v-model="formItem.corganCode" readonly></Input>
        </FormItem>
        <FormItem label="部门名称">
          <Input v-model="formItem.corganName" placeholder="Enter something..."></Input>
        </FormItem>
        <FormItem label="部门负责人账号">
          <Input v-model="formItem.mainPerson" placeholder="Enter something..."></Input>
        </FormItem>
      </Form>
      <div slot="footer">
        <Button @click="submit" type="primary">更新</Button>
        <Button @click="resetForm" type="primary">取消</Button>
      </div>
    </Modal>
  </div>
</template>

<script>
import {updateDepartment, updateEmployee} from "../../../../../../api/data";

export default {
  data() {
    return {
      modal1: false,
      formItem: {
        corganCode: '',
        corganName: '',
        mainPerson: ''
      }
    }
  },
  methods: {
    submit(){
      updateDepartment(this.formItem).then(res=>{
        if (res.data.code==500){

        }else{

        }
      }).catch(err=>{
      })
    },
    resetForm(){
      this.formItem={

      }
    },
  }
}
</script>

<style scoped>
.edit-dialog{
  display: inline-block;
}
</style>
